import { SizeEnum } from "./enums/SizeEnum";
import { LayoutEnum } from "./enums/LayoutEnum";
import { ThemeEnum } from "./enums/ThemeEnum";
import { LanguageEnum } from "./enums/LanguageEnum";
import axios from 'axios';


//初始化网站头像和标题
var siteTitle;
var siteLogoUrl;
const xhr = new XMLHttpRequest();
xhr.open('GET', import.meta.env.VITE_APP_BASE_API + '/v1/webSiteInfo', false);  // 第三个参数为false表示同步请求
xhr.send();
if (xhr.status === 200) {
  const res = JSON.parse(xhr.responseText);
  siteTitle = res.data.name+"后台管理系统";
  siteLogoUrl = res.data.logo;
} else {
  console.error('获取网站配置出错');
}
const defaultSettings: AppSettings = {
  title: siteTitle,
  version: import.meta.env.VITE_APP_VERSION,
  showSettings: true,
  tagsView: true,
  fixedHeader: true,
  sidebarLogo: true,
  layout: LayoutEnum.LEFT,
  theme: ThemeEnum.LIGHT,
  size: SizeEnum.DEFAULT,
  language: LanguageEnum.ZH_CN,
  themeColor: "#409EFF",
  watermarkEnabled: false,
  watermarkContent: siteTitle,
  logo: siteLogoUrl,
};

export default defaultSettings;
